﻿@model MMPS.Entity.ViewModel.GetPageShopsView

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Add</title>
    <link href="~/Content/Easy UI/themes/default/easyui.css" rel="stylesheet" />
    <link href="~/Content/Easy UI/themes/icon.css" rel="stylesheet" />@*图片*@
    <script src="~/Content/Easy UI/script/jquery-1.11.1.js"></script>
    <script src="~/Content/Easy UI/script/jquery.easyui.min.js"></script>
    <script src="~/Content/Easy UI/script/easyui-lang-zh_CN.js"></script>
</head>
<body>
    @using (Html.BeginForm("", "", FormMethod.Post, new { id = "Form_id" }))
    {
        <fieldset style="width:600px;border:1px solid blue">
            <legend>会员基本信息</legend>
            <table>
                @*<tr>
                        <td>学生编号：</td>
                        <td><input id="txtid" type="text" style="border:1px solid blue" /></td>
                        <td></td>
                        <td></td>
                    </tr>*@

                <tr>
                    @*<td>店铺编号：</td>
                        <td> @Html.EditorFor(model => model.S_Name, new { htmlAttributes = new { @class = "form-control" } })</td>*@
                    <td>店铺名称：</td>
                    <td> @Html.EditorFor(model => model.S_Name, new { htmlAttributes = new { @class = "form-control" } })</td>

                    <td>店铺类型：</td>
                    <td> @Html.EditorFor(model => model.S_Category, new { htmlAttributes = new { @class = "form-control" } })</td>
                </tr>
                <tr>
                    <td>联系人：</td>
                    <td> @Html.EditorFor(model => model.S_ContactName, new { htmlAttributes = new { @class = "form-control" } })</td>
                    <td>联系电话：</td>
                    <td> @Html.EditorFor(model => model.S_ContactTel, new { htmlAttributes = new { @class = "form-control" } })</td>
                </tr>
                <tr>
                    <td>地址：</td>
                    <td>  @Html.EditorFor(model => model.S_Address, new { htmlAttributes = new { @class = "form-control" } })</td>
                    <td>店铺评价：</td>
                    <td>  @Html.EditorFor(model => model.S_Remark, new { htmlAttributes = new { @class = "form-control" } })</td>
                </tr>
                <tr>
                    <td> 备注：</td>
                    <td>  @Html.EditorFor(model => model.S_IsHasSetAdmin, new { htmlAttributes = new { @class = "form-control" } })</td>
                    <td> 开店时间：</td>
                    <td>  @Html.EditorFor(model => model.S_CreateTime, new { htmlAttributes = new { @class = "form-control" } })</td>
                    @*<td><input id="classname" type="text" style="border:1px solid blue" /></td>*@
                </tr>
                @Html.HiddenFor(model => model.S_ID)
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>  <input type="button" value="提交" class="btn btn-default" id="btn" /></td>
                </tr>
            </table>
            @Html.EditorFor(model => model.S_ID, new { htmlAttributes = new { @class = "form-control" } })

        </fieldset>
    }
    <script type="text/javascript">
        $(function () {
            $("#btn").click(function () {
                var url = "/shops/Add";
                var S_ID = $("#S_ID").val();
                if (S_ID > 0) {
                    url = "/shops/Edit";
                }
                var dataForm = $("#Form_id").serializeArray();
                $.post(url, dataForm, function (data) {
                    if (data.ResultStatus == 1) {
                        window.parent.$.messager.alert("温馨提示", data.Msg, "info");
                        window.parent.$("#dlg").dialog("close");
                        window.parent.$("#dg").datagrid("reload");
                    } else {
                        //data.ResultStatus
                        window.parent.$.messager.alert("温馨提示", data.Msg, "error");

                    }
                }, "json")
            })
        })
    </script>
</body>
</html>
